﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DeepZoomPivotConstructor.VisualLib.Hotspots
{
    /// <summary>
    /// A hot spot that when selected moves to the next spot.
    /// </summary>
    public class HSActionCenterThere : HotSpotActionBase
    {
        Visual _destination;

        public HSActionCenterThere(Visual showThisGuy)
        {
            _destination = showThisGuy;
        }

        /// <summary>
        /// Return the data for what this guy is. Note that it says
        /// </summary>
        public override string LinkType
        {
            get { return "center"; }
        }

        /// <summary>
        /// Returns the link data. Note - this info is returned _when_ 
        /// it is called - so if Visual is moved around, then the rect here
        /// might not be right!
        /// </summary>
        public override string LinkData
        {
            get {
                StringBuilder bld = new StringBuilder();
                var bb = _destination.VisualBoundingBox;
                bld.Append(bb.XPosition);
                bld.Append(",");
                bld.Append(bb.YPosition);
                bld.Append(",");
                bld.Append(bb.Width);
                bld.Append(",");
                bld.Append(bb.Height);

                return bld.ToString();
            }
        }
    }
}
